#include<stdio.h>
#include"array.h"

void sort(int a[], int s, int e) {
	if (s < e) {
		int j, k, t;
		for (k = s, j = s + 1; j <= e; j++)
			if (a[j] < a[k])
				k = j;
		if (k - s)
			t = a[k], a[k] = a[s], a[s] = t;
		sort(a, s + 1, e);
	}
}

int main() {
	int a[] = { 1, 5, 3, 7, 0, 4, 2, 8, 6, 9, };
	int n = sizeof(a) / sizeof(a[0]);
	print(a, n);
	sort(a, 0, n - 1);
	print(a, n);

	return 0;
}
